package com.uu.it.tracker.twitter;

import android.util.Log;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;

public class TwitterUpdater {
	/*twitter account's name*/
	private String _accountName;
	/*twitter account's password*/
	private String _passWord;
	
	public TwitterUpdater(String accountName, String passWord) {
		_accountName = accountName;
		_passWord = passWord;
	}
	/*update message to twitter*/
	public void updateMessage(String message){
		TwitterFactory tf = new TwitterFactory();
		Twitter twitter = tf.getInstance(
				_accountName, _passWord);
		try {
			
			 twitter.updateStatus(message);
			
		} catch (TwitterException e) {
			// TODO Auto-generated catch block
			Log.i("Twitter", e.toString());
			//e.printStackTrace();
		}
	}
}
